package com.javafactroy.kunlong.bip.icp.message.base.codec;

import org.apache.commons.lang3.StringUtils;

import java.io.UnsupportedEncodingException;

public class LineBasedFrameDecoder {
    final static String LINE_WINDOWS_CHAR="\r\n";
    final static String LINE_LINUX_CHAR="\r\n";

    String[] decode(byte[] msg){
        try {
            return StringUtils.split(new String(msg,"utf-8"),LINE_WINDOWS_CHAR);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
}
